package com.hackerrank.challenges.splitthephonenumbers;

import java.util.Scanner;

public class Solution {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		in.nextLine();
		for(int n = 0; n < N; n++) {
			String w[] = in.nextLine().split("[ -]");
			System.out.println("CountryCode=" + w[0] + ",LocalAreaCode=" + w[1] + ",Number=" + w[2]);
		}
	}
}
